﻿@model IEnumerable<HotelManageSystem.Models.PostModel>
<link href= "@Url.Content("~/Content/TelerikGrid.css")"rel="stylesheet" type="text/css" />
<style>
    textarea
    {
        max-width: 220px;
        max-height: 50px;
        min-width: 220px;
        min-height: 50px;
        resize: none; 
    }
</style>
@(
 Html.Telerik().Grid(Model)
                    .Name("PostGrid")
                    .DataKeys(keys => keys.Add(p => p.ID))
                    .ToolBar(command => command.Insert())
                    .DataBinding(dataBinding => dataBinding.Ajax()
                                 .Select("TelerikAjax", "Post")
                                 .Insert("Insert", "Post")
                                 .Update("Update", "Post")
                                 .Delete("Delete", "Post")
                                 )
                    .Sortable(sorting => sorting
                                 .SortMode(GridSortMode.SingleColumn))
                    .Pageable(paging => paging
                                 .Style(GridPagerStyles.NextPreviousAndNumeric)
                                 .Position(GridPagerPosition.Bottom)
                                 .PageSize(5))
                    .Columns(columns =>
                                 {
                                     columns.Bound(p => p.Title).Width(210);
                                     columns.Bound(p => p.Remark)
                                           .Template(pi => @Html.Raw("<textarea id='roleReamrk' name='roleRemark' rows='3' cols='50' disabled='disabled'>" + pi.Remark + "</textarea>"))
                                           .ClientTemplate("<textarea id='roleReamrk' name='roleRemark' rows='3' cols='50' disabled='disabled'><#= Remark #></textarea>")
                                           .Width(210);
                                     columns.Command(command =>
                                                         {
                                                             command.Edit();
                                                             command.Delete();
                                                         });
                                 })
                    .Editable(editing => editing.Mode(GridEditMode.PopUp))
                    .Selectable()
)
